package com.anosine.gpsl.android.ui.activity;

import com.anosine.gpsl.android.R;
import com.anosine.gpsl.android.base.BaseActivity;
import com.anosine.gpsl.android.entity.PushMessageBean;
import com.anosine.gpsl.android.ui.fragment.CommonHeaderFragment;
import com.anosine.gpsl.android.util.BundleKey;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

/**
 * **********************************************************
 * <p/>
 * 说明：设置推送够来的详细信息界面
 * <p/>
 * 作者：
 * <p/>
 * 创建日期：2015/5/23
 * <p/>
 * 描述： **********************************************************
 */
public class ShowReceivePushActivity extends BaseActivity implements
		View.OnClickListener {


	@Override
	protected void onBaseCreate(Bundle savedInstanceState) {
		showInfo(getIntent());
	}

	private void showInfo(Intent intent) {
		setContentView(R.layout.activity_receive_push);
		// TextView mTvShow= (TextView) findViewById(R.id.tv_show_receive_push);
		TextView mTvTitle = (TextView) findViewById(R.id.Message_title);
		TextView mTvDate = (TextView) findViewById(R.id.Message_date);
		TextView mTvContext = (TextView) findViewById(R.id.Message_context);

		if (intent != null) {
			Bundle args = intent.getExtras();
			if (args != null) {
				PushMessageBean bean = (PushMessageBean) args
						.getSerializable(BundleKey.TAG_SCENERY_DATA);
				if (bean != null) {
					mTvTitle.setText(bean.getTitle());
					mTvDate.setText(bean.getId());
					if (bean.getDesc().contains("$url$")) {
						// 描述处理
						String[] getUrl = bean.getDesc().split("\\$url\\$");
						String content = "";
						for (int i = 0; i < getUrl.length - 1; i++) {
							content = content + getUrl[i];
						}
						mTvContext.setText(content);

					} else {
						mTvContext.setText(bean.getDesc());

					}
				}
			}
			
					
			
		}
	}

	@Override
	protected void initViews() {

	}

	@Override
	public void onClick(View view) {
		switch (view.getId()) {
		}
	}

	@Override
	protected void onNewIntent(Intent intent) {
		super.onNewIntent(intent);

	}
}
